import {defineStore} from "pinia"

//创建studentInfoState类

//studentStateStore 这个是解构的名字
export const studentStateStore = defineStore({
    id:"studentState",
    state:()=>{
        return{
            studentId:"",
            studentName:"",
            studentAccount:"",
            studentPassword:"",
            studentLoginState:"0",
            studentXueHao:""

        };
    },
    getters:{
        getterStudentId(state){
            console.log("StudentInfo被调用输出"+state.studentId)
            return state.studentId;
        },
        getterStudentName(state){
            console.log("StudentInfo被调用输出"+state.studentName)
            return state.studentName;
        },
        getterStudentAccount(state){
            console.log("StudentInfo被调用输出"+state.studentAccount)
            return state.studentAccount;
        },
        getterStudentPassword(state){
            console.log("StudentInfo被调用输出"+state.studentPassword)
            return state.studentPassword;
        },
        getterStudentstudentLoginState(state){
            console.log("StudentInfo被调用输出"+state.studentLoginState)
            return state.studentLoginState;
        },
        getterStudentXueHao(state){
            console.log("StudentInfo被调用输出"+state.studentLoginState)
            return state.studentXueHao;
        }
    },
    //setter
    
    actions:{
        setterStudentId(id){
            this.studentId=id
        },
        setterStudentName(name){
            this.studentName=name
        },
        setterStudentAccount(account){
            this.studentAccount=account
        },
        setterStudentPassword(password){
            this.studentPassword=password
        },
        setterStudentLoginState(loginState){
            this.studentLoginState=loginState
        },
        settergetterStudentXueHao(xuehao){
            this.studentXueHao=xuehao
        }       
    }
})